package com.kd.test.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionSupport;

//
public class MoreSubmitAction extends ActionSupport implements ServletRequestAware {
	private String msg;
	private HttpServletRequest request;
	
	public String print(){
		request.setAttribute("printMsg", "打印"+msg+"成功");
		return "print";
	}
	public String save(){
		request.setAttribute("saveMsg", "保存"+msg+"成功");
		return "save";
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	//ServletRequestAware这个接口为sturts2的内置拦截器，旨在获得httpServletRequest
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request = request;
	}
}
